/**
 * Created by dale on 2017/8/14.
 */
$(document).ready(function () {

    var form=new xhForm($('.xh-form'));


    var $depId=addressUri.getParam('iDepId');
    var $depName=addressUri.getParam('sDepName');
    $depName=unescape($depName);
    $('[name="iDepId"]').val($depId);
    $('[name="sDepName"]').val($depName);

    $(".form-date").datetimepicker({format: 'yyyy-mm-dd',language: 'zh-CN',minView: "month", autoclose:true});
    $(".form-month").datetimepicker({format: 'yyyy-mm',language: 'zh-CN',minView: "year", autoclose:true});

    $('#bt_modal_confirm',parent.document).addClass('disabled');

    form.parse().bindRequired($('#bt_modal_confirm',parent.document));
    
    $('#bt_modal_confirm',parent.document).click(function () {
        form.submit('hrm/staff/saveStaff', {},function (res) {
            // console.log(res);
            window.top.xhTop.showSuccess(res.msg);
            window.top.xhTop.closeModal();
            window.top.xhTop.getActiveFrame().staffList.dataGridReload();
        });
        // $('#xh_form').submit();

    });

    modalBind.bindClick();

});